import { Column, Entity } from 'typeorm';
import { SexEnum } from '../enum/common.enum'
import { CommonEntity } from './common.entity'

@Entity('tt_user')
export class UserEntity extends CommonEntity{

    @Column({ length: 50, nullable:false})
    username: string;

    @Column({ length: 50, nullable:false })
    password: string;

    @Column({ length: 30, nullable:true })
    email: string;

    @Column({ length: 50, nullable:true })
    addr: string;

    @Column({ 
            type:'enum',
            nullable:true,
            enum:SexEnum,
            default: SexEnum.UNKNOW  
    })
    sex: string; 

    @Column({  type:'int' , nullable:true  })
    tel: number; 

    @Column({ length: 50, nullable:true })
    salt: string;
}